Skip to content

17: Recipes — the shapes a host writes, and what each policy does - #31

Merged
d4mation merged 2 commits into
mainfrom
17-recipes-doc
Aug 20, 2026
Merged

17: Recipes — the shapes a host writes, and what each policy does#31
d4mation merged 2 commits into
mainfrom
17-recipes-doc

Conversation

@nikolaystrikhar

@nikolaystrikhar nikolaystrikhar commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What: adds docs/recipes.md — a settings toggle, a manifest of add-ons, the policy outcomes, the release rollout, version negotiation and per-site multisite activation — with the load gate chain, the policy branches and the rollout as Mermaid diagrams; linked from the README's doc list and from conflict-handling.md's version-negotiation note.

Read it rendered on the branch — the diagrams only draw in the blob view, not in this diff.

Usage:

Absorber::register( [
    'slug'                       => 'give-recurring',
    'bundled_plugin_file'        => GIVE_PLUGIN_DIR . 'sub-plugins/give-recurring/give-recurring.php',
    'plugin_loaded_constant'     => 'GIVE_RECURRING_VERSION',
    'standalone_plugin_basename' => 'give-recurring/give-recurring.php',
    'enabled'                    => static fn() => (bool) get_option( 'give_recurring_enabled', true ),
] );

Why this way:

Task-organized, in its own file. The five existing docs are organized by mechanism — every key, every filter, every gate — and none of them answers "how do I ship a toggle". The README is capped at ~120 lines and is at 84, so this could not go there.

The tagline's own case was undemonstrated. "Togglable or always-on" has been on the README since the first commit, and the only enabled example anywhere was a licence check. The toggle recipe also states the two things that surprise people: switching it off unloads nothing until the next request, and it stands the conflict pass down as well.

Version negotiation gets a worked example, not another disclaimer. It is the decision this library keeps being asked to reopen. Ten lines of conflict_policy filter is a cheaper answer than the paragraph explaining why it is out of scope.

Diagrams are Mermaid, and they parse. Every block was run through Mermaid's own parser, and every PHP snippet through php -l.

Comment thread docs/recipes.md Outdated
Comment thread docs/recipes.md
Comment thread docs/recipes.md Outdated
- Replace the "defer to a newer standalone" recipe with the case that
  actually occurs: a later standalone version that is a new codebase
  under the same basename, worked through ProPanel 2.x/3.0
- Stop claiming DEFER stands the bundled copy down; that is the load
  guard's doing, and a standalone that never defines the constant
  leaves both copies loading
- Say up front that the manifest loop builds one config array per
  sub-plugin, and what the + union contributes
- Note that a policy read from an option is re-read on every conflict
  pass, so anything writing it changes the next resolution

DEFER's behavior now points at the load guard section that documents
it, with the recipe as an example of it rather than the explanation.
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Enterprise

Run ID: 734d0026-b05a-478d-a7a0-bed6e739914e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Base automatically changed from 16-readme-release to main August 20, 2026 19:48
@d4mation
d4mation merged commit 8dc02f4 into main Aug 20, 2026
6 checks passed
@d4mation
d4mation deleted the 17-recipes-doc branch August 20, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants